Appearance
Object Usage Report
Info Snapshot analysed 206 tables · 102 views · 516 procedures · 8 functions (from
schemas/, daily export of the live database). Generated 2026-07-10 by scripted analysis of the JSON snapshots.
Method
- View → table references were taken from each view file's
dependenciesarray, matched case-insensitively against table names. - Procedure → table references were found by searching each procedure's
definitionSQL for the table name as a whole word (case-insensitive). - Broken references were found by extracting
FROM / JOIN / INSERT INTO / UPDATE / DELETE FROM / EXEC dbo.<name>patterns (explicitdbo.prefix only, comments stripped) and checking the name against every known table, view, procedure and function in the snapshot.
Warning Caveats
- Name matching cannot see dynamic SQL (strings built and passed to
sp_executesql), so usage counts are lower bounds and "orphan" is not proof a table is unused.- Usage from outside the database (application code, SSRS, Power BI, agent jobs, external ETL) is invisible to this analysis. Staging tables written by integrations may legitimately show zero references.
- A whole-word match on a table name inside a procedure counts comments and string literals as references, so procedure counts can be slightly inflated.
- The broken-reference scan only checks two-part
dbo.-qualified names; unqualified references to missing objects are not flagged (the unqualified scan produced too many alias false positives to be reliable).
1. Orphan tables
Tables referenced by no view and no procedure in the snapshot — 25 of 206. Sixteen are explicitly deprecated or temporal-history artefacts; the other nine (bold) deserve a closer look before being written off.
| Table | Notes |
|---|---|
| A&GPredefinedEstimateItems | Lookup/import data; possibly used only by app code |
| EthAppointmentConfig_Depcreated | Deprecated |
| EthNonPrefinedItems | Lookup/import data |
| EventLog_Deprecated | Deprecated |
| MSSQL_TemporalHistoryFor_731865674 | System-generated temporal history table |
| PB_DateDim | Power BI date dimension — likely consumed directly by Power BI |
| PredefinedEstimateItems | Lookup/import data |
| PrimeAccountsPayableInvoices_Depcrecated | Deprecated |
| ethAppointmentInstance | No DB-side consumers found |
| ethBookingAppointmentSkill | No DB-side consumers found |
| ethBookingEstimator_Deprecated | Deprecated |
| ethGeoLocationStatus | No DB-side consumers found |
| ethFlowLogs_Deprecated | Deprecated |
| ethKpiMeasures_Deprecated | Deprecated |
| ethKpiResultsActive_Deprecated | Deprecated |
| ethKpiResultsClosed_Deprecated | Deprecated |
| ethPrimeInvoiceUser | No DB-side consumers found |
| ethStagehandTasks | Probably written/read by the Stagehand integration directly |
| ethTaskSchedule_Deprecated | Deprecated |
| ethWIPClientHistory_Deprecated | Deprecated |
| kpiTableLookup_Deprecated | Deprecated |
| kpiTableResponsibilitiesLookup_Deprecated | Deprecated |
| primeJobsTemp | Temp/staging copy of primeJobs |
| wipStatus | Lookup table |
2. Hub tables (top 20 by total references)
| # | Table | Views | Procedures | Total |
|---|---|---|---|---|
| 1 | primeJobs | 56 | 110 | 166 |
| 2 | primeUsers | 33 | 46 | 79 |
| 3 | primeContacts | 9 | 50 | 59 |
| 4 | ethBooking | 6 | 35 | 41 |
| 5 | makesafeUser | 2 | 36 | 38 |
| 6 | makesafePhoneCall | 2 | 34 | 36 |
| 7 | optimoRouteOrder | 3 | 32 | 35 |
| 8 | primeAppointments | 3 | 25 | 28 |
| 9 | primeStatuses | 23 | 5 | 28 |
| 10 | ethBookingEstimatorSkill | 2 | 21 | 23 |
| 11 | primeStatusHistories_Job | 10 | 12 | 22 |
| 12 | ethWIPJobHistory | 6 | 14 | 20 |
| 13 | makesafeSMSMessage | 0 | 20 | 20 |
| 14 | makesafeSiteOptions | 0 | 18 | 18 |
| 15 | primeJobsLocation | 7 | 11 | 18 |
| 16 | primeAppointmentType | 3 | 14 | 17 |
| 17 | elevenLabsConversations | 2 | 14 | 16 |
| 18 | ethTask | 0 | 16 | 16 |
| 19 | primeWorkOrders | 4 | 11 | 15 |
| 20 | primeAllocations | 4 | 10 | 15 |
primeJobs is by far the centre of the schema (referenced by more than half of all views). primeUsers, primeContacts and primeStatuses form the core Prime Ecosystem cluster; ethBooking/ethBookingEstimatorSkill, the makesafe* group, and optimoRouteOrder are the main Ethos-built clusters.
3. Deprecated-style objects
Tables with deprecated/stage/temporal/EventLog names
| Table | Still referenced? |
|---|---|
| EthAppointmentConfig_Depcreated | No |
| EventLog_Deprecated | No |
| MSSQL_TemporalHistoryFor_731865674 | No (system temporal history) |
| PrimeAccountsPayableInvoices_Depcrecated | No |
| ethBookingEstimator_Deprecated | No |
| ethFlowLogs_Deprecated | No |
| ethKpiMeasures_Deprecated | No |
| ethKpiResultsActive_Deprecated | No |
| ethKpiResultsClosed_Deprecated | No |
| ethTaskSchedule_Deprecated | No |
| ethWIPClientHistory_Deprecated | No |
| kpiTableLookup_Deprecated | No |
| kpiTableResponsibilitiesLookup_Deprecated | No |
| primeExportsEndataScopeImport_stage | Yes — 5 references (active staging table) |
| makesafeEventLog | Yes — 2 references |
| makesafeEventLogAction | Yes — 1 reference |
All 13 _Deprecated/_Depcreated/_Depcrecated tables have zero references — they appear safe to drop from the live database. The _stage and makesafeEventLog* tables are in active use despite the suggestive names.
Deprecated-named views and procedures (all _Deprecated variants)
7 views (vEthKpiResults*_Deprecated, vKpiResultsClosed_Deprecated) and 21 procedures (booking, KPI, spEthTask*, OptimoRoute variants) carry a deprecated suffix. None of them is referenced by any other view or procedure in the snapshot. Note that several of these deprecated procs are the only remaining "users" of already-dropped tables (see §4), confirming they no longer run.
spMakesafeInsertEventLog is referenced 18 times but is an active event-logging proc, not deprecated — it only matched on the "EventLog" pattern.
4. Broken references (SQL referencing objects that no longer exist)
Objects whose SQL references a dbo.-qualified table absent from schemas/tables/ (and not a view/proc/function either):
| Referencing object | Kind | Missing object(s) |
|---|---|---|
| vReportFilterSupervisorType | view | kpiTableResponsibilitiesLookup |
| spPrimeGetQueuedEmailMessages | procedure | EmailMessageQueue |
| spPrimeGetQueuedEmailMessagesCount | procedure | EmailMessageQueue |
| spPrimeUpdateQueuedEmailMessage | procedure | EmailMessageQueue |
| vEthKpiResultsActive_Deprecated | view | kpiTableResponsibilitiesLookup |
| spEthBookingDaySlotUpsert_deprecated | procedure | ethBookingEstimator |
| spEthBookingGetAvailabilityPerSlot_Deprecated | procedure | ethBookingEstimator |
| spEthTaskGetFlowsToCancel_Deprecated | procedure | ethTaskSchedule |
spEthTaskGetNext_Depcrecated + 6 other spEthTask*_Dep* procs | procedures | ethTaskSchedule |
| spPopulateKpiDate_Deprecated | procedure | kpiDate |
| CommandExecute, DatabaseIntegrityCheck, IndexOptimize | procedures | CommandLog, Queue, QueueDatabase (Ola Hallengren maintenance objects — referenced conditionally, benign) |
| sp_upgraddiagrams | procedure | dtproperties (legacy SQL Server diagram support, benign) |
Key points:
- The four bold rows are not deprecated-named objects:
vReportFilterSupervisorTypewill fail at runtime (its source table survives only askpiTableResponsibilitiesLookup_Deprecated), and the threespPrime*QueuedEmailMessage*procs reference anEmailMessageQueuetable that does not exist in the snapshot at all. - Everything else is a deprecated proc/view pointing at a table that has since been renamed
_Deprecatedor dropped — consistent evidence that those objects are dead and safe to remove. - No view
dependenciesarray points at a missing object (0 broken dependency entries).

